import xlsxwriter
# Create an new Excel file and add a worksheet.
workbook = xlsxwriter.Workbook('demo.xlsx')
worksheet = workbook.add_worksheet()


merge_format = workbook.add_format({
    'border': 1,
    'bold':True,
    'font_size':12,
    'align':'center',
    'valign':'vcenter',
});
worksheet.merge_range('B2:M2','开发日报',merge_format)

sub_title = workbook.add_format({
    'border':1,
    'bold':True,
    'font_size':11,
    'align':'left',
    'valign':'vcenter',
})
worksheet.merge_range('B3:G3','本周工作概要',sub_title)
worksheet.merge_range('H3:M3','下周工作重点',sub_title)

time_label = workbook.add_format({
    'border':1,
    'bold':True,
    'font_size':11,
    'align':'center',
    'valign':'vcenter',
})
worksheet.write('B4','时间周期',time_label)
worksheet.merge_range('H4:I4','时间周期',time_label)

time_duration = workbook.add_format({
    'border':1,
    'font_size':11,
    'align':'center',
    'valign':'vcenter',
})
worksheet.merge_range('C4:F4','2016年4月19日-2015年4月23日',time_duration)
worksheet.merge_range('J4:L4','2016年4月19日-2015年4月23日',time_duration)

normal_content = workbook.add_format({
    'border':1,
    'font_size':11,
    'align':'left',
    'valign':'vcenter',
})
worksheet.write('G4','第16周',normal_content)
worksheet.write('M4','第17周',normal_content)

worksheet.merge_range('B5:G6','车小丫官微后台',normal_content)
worksheet.merge_range('H5:M6','车小丫官微后台',normal_content)

worksheet.merge_range('B7:G7','所遇问题、解决方案及建议',sub_title)
worksheet.merge_range('H7:M7','等待事项',normal_content)

worksheet.merge_range('B8:G10','',normal_content)
worksheet.merge_range('H8:M8','',normal_content)

worksheet.merge_range('H9:M9','其他事项',sub_title)
worksheet.merge_range('H10:M10','',sub_title)


workbook.close()
